Class yassl.Env
All Packages This Package Previous Next
Class yassl.Env
java.lang.Object
|
+----yassl.Env
-
public class
Env
-
extends Object
This is effectively a frame for a method call.
It contains bindings for varnodes -> contents.
Like Scheme, bindings for variables are
determined by searching for its value upwards
from the frame in which an expression is evaluated.
The other thing implemented here is dynamic loading
of toplevel functions. If a symbol is not
found, a getClass() is performed on a mangled
version of the name to try and get the function
definition. This needs to be fixed to be done
only when the variable is a lambdanode.
-
local
-
local variable binding table
-
parent
-
parent environment.
-
Env()
-
-
define(String, pnode)
-
add a new variable to the environment
-
define(String[], pnode[])
-
add a set of new variables to the environment
-
search(String)
-
Searching looks up the object, and bumps the query up to the
parent if necessary.
-
set(String, pnode)
-
set! an existing variable to a new value.
local
public Hashtable local
-
local variable binding table
parent
public Env parent
-
parent environment. If a binding is not found here, the
search is passed up to this environment.
Env
public Env()
set
public void set(String v,
pnode binding) throws yasslError
-
set! an existing variable to a new value.
define
public void define(String v,
pnode binding)
-
add a new variable to the environment
define
public void define(String v[],
pnode b[]) throws yasslError
-
add a set of new variables to the environment
search
public pnode search(String v) throws yasslError
-
Searching looks up the object, and bumps the query up to the
parent if necessary. If a binding is not found, a last ditch
attempt is made to try to get it as a lambda node from a class.
This needs to be fixed to first verify the varnode is of a
lambda type.
All Packages This Package Previous Next